<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('rd_alarm_handle_record', function (Blueprint $table) {
            $table->comment('工单处置记录');
            $table->bigIncrements('id');
            $table->unsignedBigInteger('work_id')->comment('工单id');
            $table->unsignedBigInteger('user_id')->comment('处置人id');
            $table->unsignedInteger('handle_type')->comment('处置类型');
            $table->json('handle_info')->nullable()->comment('处置信息');
            $table->timestamps();
            $table->index('work_id', 'idx_work_id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('rd_alarm_handle_record');
    }
};